import request from '@/utils/request'

// 登录方法
export function login(username, password, code, uuid) {
  const data = {
    username,
    password,
    code,
    uuid
  }
  return request({
    url: '/login',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 注册方法
export function register(data) {
  return request({
    url: '/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    headers: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}

// 短信验证码
export function getCodeSms() {
  return request({
    url: '/captchaSms',
    headers: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}


// 注册方法
export function pay(query) {
  return request({
    url: '/api/v1/pay',
    method: 'get',
    params: query
  })
}

export function query(query) {
  return request({
    url: '/api/v1/query',
    method: 'get',
    params: query
  })
}



export function dllPay(query) {
  return request({
    url: '/api/dll/pay',
    method: 'get',
    params: query
  })
}
// 预授权完成
export function dllPayOver (query) {
  return request({
    url: '/bank/v1/preauthcmp',
    method: 'get',
    params: query
  })
}


export function getroleList(query) {
  return request({
    url: '/api/dll/select',
    method: 'get',
    params: query
  })
}

export function signApi(query) {
  return request({
    url: '/bank/v1/sign',
    method: 'get',
    params: query
  })
}

export function preauthcmpApi(query) {
  return request({
    url: '/bank/v1/preauthcmp',
    method: 'get',
    params: query
  })
}

export function preauthcmpcancelApi(query) {
  return request({
    url: '/bank/v1/preauthcmpcancel',
    method: 'get',
    params: query
  })
}

export function preauthcanceApi(query) {
  return request({
    url: '/bank/v1/preauthcance',
    method: 'get',
    params: query
  })
}

export function refundApi(query) {
  return request({
    url: '/bank/v1/refund',
    method: 'get',
    params: query
  })
}

export function preauthorizeApi(query) {
  return request({
    url: '/bank/v1/preauthorize',
    method: 'get',
    params: query
  })
}
//快速担保完成
export function quickcompleteauthorization(query) {
  return request({
    url: '/bc/v1/quickcompleteauthorization',
    method: 'get',
    params: query
  })
}

//快速担保撤销
export function quickvoidauthorization(query) {
  return request({
    url: '/bc/v1/quickvoidauthorization',
    method: 'get',
    params: query
  })
}

//交易
export function bcpay(query) {
  return request({
    url: '/bc/v1/pay',
    method: 'get',
    params: query
  })
}

//撤销
export function voidpayment(query) {
  return request({
    url: '/bc/v1/voidpayment',
    method: 'get',
    params: query
  })
}


